home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / xcmd / xrulesde.sit / Xrules™ Demo / card_24717.txt < prev    next >
Encoding:
Text File  |  1991-06-24  |  4.7 KB  |  92 lines

  1. -- card: 24717 from stack: in
  2. -- bmap block id: 24950
  3. -- flags: 4000
  4. -- background id: 7992
  5. -- name: 7-Monitor Card
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 01
  10. -- high flags: 0007
  11. -- rect: left=2 top=24 right=311 bottom=510
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 22
  16. -- text size: 10
  17. -- style flags: 0
  18. -- line height: 13
  19. -- part name: 
  20.  
  21.  
  22. -- part 3 (button)
  23. -- low flags: 00
  24. -- high flags: 0000
  25. -- rect: left=256 top=314 right=337 bottom=281
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 1013 / 1013
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Next
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   go to next card
  37. end mouseUp
  38.  
  39.  
  40.  
  41. -- part 5 (button)
  42. -- low flags: 00
  43. -- high flags: 8002
  44. -- rect: left=58 top=313 right=327 bottom=79
  45. -- title width / last selected line: 0
  46. -- icon id / first selected line: 0 / 0
  47. -- text alignment: 1
  48. -- font id: 0
  49. -- text size: 12
  50. -- style flags: 0
  51. -- line height: 16
  52. -- part name: 19
  53. ----- HyperTalk script -----
  54. on mouseUp
  55.   push this card
  56.   go to card "Fig. 19"
  57. end mouseUp
  58.  
  59.  
  60.  
  61. -- part contents for card part 1
  62. ----- text -----
  63. The monitor card allows you to trace the actions of the inference engine.  It includes a trace field which shows the actions taken by the inference engine, a facts field which shows the facts asserted and their values, and a stack field which shows the rules and facts to be processed.  The monitor card also enables you to step through the inference process.  These features make the monitor card an effective debugging tool.  Figure 19 shows the monitor card.
  64.  
  65. To use the monitor card you should first set the check boxes "trace" and "step" to turn these features on or off.  Next, you should select backward or forward chaining.  If you select backward chaining, you must enter the goal into the 
  66. "goal" field.  Then, click on the "init" button to initialize the system (or enter carriage return in the goal field).  To continue when "stepping" through the session, click on the "continue" button. 
  67.  
  68. The trace feature controls the "Trace" field, the "Facts" field, and the "Stack" field.  If it is on, the inference engine will enter the appropriate trace data in these fields.
  69.  
  70. NOTE:  The "Stack" field on the monitor card grows down.  Items are pushed and popped at the bottom of the "Stack" field.
  71.  
  72. The step feature allows you to break after each major action by the inference engine.  If it is on, the inference engine will go to the monitor card and wait for you to click on "continue" to begin again.
  73.  
  74. The arrow and bar (->|) button on the monitor allows you to return to the init, fact, or conclusion card where you last clicked on a bar and arrow (|<-) button.  Remember that if you go to the monitor card from a fact card, you should return to the fact card and answer any questions posed by it.  If you use the "continue" button on the monitor card to begin again, the system will NOT return to the fact card and the fact that should have been asserted at that card will not be asserted.
  75.  
  76. As with the compiler card, feel free to modify the monitor card in any way that suits you.  The trace and step functions are controlled by special global variables as follows:
  77.  
  78. ILSI_TRACE - If set to a string defining a field, it will cause the inference engine to post trace messages in that field.  Setting the variable to null (""), disables the activity trace function.  The field specification must be enclosed in quotes so that HyperTalk will not attempt to evaluate it.
  79.  
  80. ILSI_FACTS - If set to a string defining a field, it will cause the inference engine to post fact names and their values into that field as they are asserted.  Setting the variable to null (""), disables the fact trace function.  The field specification must be enclosed in quotes so that HyperTalk will not attempt to evaluate it.
  81.  
  82. ILSI_STACK - If set to a string defining a field, it will cause the inference engine to display the stack in that field.  Setting the variable to null (""), disables the stack trace function.  The field specification must be enclosed in quotes so that HyperTalk will not attempt to evaluate it.
  83.  
  84. ILSI_STEP  - If set to the name of a card, it will cause the inference engine to operate in step mode and to return to the named card at each step.  Setting the variable to null (""), disables the step function.
  85.  
  86. The monitor card uses the "scrollToBottom"  XCMD to scroll to the bottom of fields on the card.   The format for that XCMD is as follows:
  87.  
  88.     SCROLLTOBOTTOM field_specification
  89.  
  90. The XCMD will automatically calculate the proper scroll setting based on the size of the window, the text height, and the number of lines of text.  The field specification must be enclosed in quotes so that HyperTalk will not attempt to evaluate it.
  91.  
  92.